import { createSlice } from "@reduxjs/toolkit";

interface DrawerType{
    visible:boolean;
}

const initialState:DrawerType={
    visible:localStorage.getItem("visible")==="true"
}

const drawerSlice=createSlice({
    name:"drawer",
    initialState,
    reducers:{
        changeDrawer(state){
            state.visible=!state.visible
        }
    }
})

export const {changeDrawer} = drawerSlice.actions
export default drawerSlice.reducer